package cn.cdzdjd.service.impl;

import javax.annotation.Resource;

import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.stereotype.Service;

import cn.cdzdjd.service.EMailService;

@Service
public class EMailServiceImpl implements EMailService {
	@Resource
	JavaMailSender javaMailSender;

	@Override
	public void sendMail(String from, String to, String cc, String subject, String text) {
		SimpleMailMessage smm = new SimpleMailMessage();
		smm.setFrom(from);// 发送者
		smm.setTo(to);// 收件人
		smm.setCc(cc);// 抄送人
		smm.setSubject(subject);// 邮件主题
		smm.setText(text);// 邮件内容
		javaMailSender.send(smm);// 发送邮件
	}

}
